package com.bdqn.service;

import java.util.List;

import com.bdqn.dao.StudentDaoImpl;
import com.bdqn.entity.Student;

public class MainService {

	public static void main(String[] args) {
		/*
		 * 分别调用增删改查的方法
		 */
		/*Student student = new Student("曹雪芹", "111111", "男", 2);
		int rows = new StudentDaoImpl().insert(student);
		if(rows>0) {
			System.out.println("数据添加成功");
		}else {
			System.out.println("数据添加失败");
		}*/
		
		/*Student student = new Student(3, "施耐庵", "223344", "男", 4);
		int rows=new StudentDaoImpl().update(student);
		if(rows>0) {
			System.out.println("数据修改成功");
		}else {
			System.out.println("数据修改失败");
		}*/
		
		/*int rows=new StudentDaoImpl().delete(8);
		if(rows>0) {
			System.out.println("数据删除成功");
		}else {
			System.out.println("数据删除失败");
		}*/
		
		List<Student> list = new StudentDaoImpl().selectAll();
		for (Student student : list) {
			System.out.println(student);
		}
		
	}


}
